package com.stylefeng.guns.common.persistence.model;

import java.io.Serializable;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * <p>
 * lg_题库分类
 * </p>
 *
 * @author xin123
 * @since 2018-01-30
 */
@TableName("lg_question_category")
public class QuestionCategory extends Model<QuestionCategory> {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    private Integer id;
    /**
     * 父id
     */
    @NotNull(message="请选择父分类！")
    private Integer pid;
    /**
     * pids
     */
    private String pids;
    /**
     * 分类名称
     */
    @Length(min = 1, max = 100, message = "分类名称字数必须在1到100之间")
    @NotBlank(message="分类名称不能为空")
    private String name;
    /**
     * 比重
     */
    @Range(min = 0, max = 99, message = "比重必须在0到99之间")
    @NotNull(message="比重不能为空")
    private Integer proportion;
    /**
     * 是否可用
     */
    private Boolean available;
    /**
     * 备注
     */
    @Length(max = 1000, message = "备注字数不得大于1000")
    private String remarks;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getPid() {
        return pid;
    }

    public void setPid(Integer pid) {
        this.pid = pid;
    }

    public String getPids() {
        return pids;
    }

    public void setPids(String pids) {
        this.pids = pids;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getProportion() {
        return proportion;
    }

    public void setProportion(Integer proportion) {
        this.proportion = proportion;
    }

    public Boolean getAvailable() {
        return available;
    }

    public void setAvailable(Boolean available) {
        this.available = available;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "QuestionCategory{" +
        "id=" + id +
        ", pid=" + pid +
        ", pids=" + pids +
        ", name=" + name +
        ", proportion=" + proportion +
        ", available=" + available +
        ", remarks=" + remarks +
        "}";
    }
}
